package com.itheima.controller;

import com.itheima.manager.SmsHomeManager;
import com.itheima.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/home")
public class SmsHomeController {

    @Autowired
    SmsHomeManager smsHomeManager;

    //品牌推荐分页
    @GetMapping("/brand/list")
    public R findByPage(@RequestParam(required = false) Integer pageNum, @RequestParam(required = false) Integer pageSize, @RequestParam(required = false) String brandName, @RequestParam(required = false) Integer recommendStatus) {
        return smsHomeManager.findByPage(pageNum, pageSize, brandName, recommendStatus);
    }

    //单个&批量 推荐|取消推荐
    @PostMapping("/brand/update/recommendStatus")
    public R updateRecommendStatus(@RequestParam("ids") List<Long> ids, @RequestParam("recommendStatus") Integer recommendStatus) {
        return smsHomeManager.updateRecommendStatus(ids, recommendStatus);
    }

    //批量删除

}
